#include <xen/shutdown.h>
#include <xen/shadow.h>
#include <xen/mm.h>
+#include <xen/softirq.h>
#include <asm/htab.h>
#include <asm/current.h>
#include <asm/hcalls.h>
-extern void idle_loop(void);
-
#define next_arg(fmt, args) ({ \
unsigned long __arg; \
switch ( *(fmt)++ ) \
} \
__arg; \
})
+extern void idle_loop(void);
unsigned long hypercall_create_continuation(unsigned int op,
const char *format, ...)
}
}
-
void context_switch(struct vcpu *prev, struct vcpu *next)
{
struct cpu_user_regs *stack_regs = guest_cpu_user_regs();
void arch_dump_domain_info(struct domain *d)
{
}
+
+extern void sleep(void);
+static void safe_halt(void)
+{
+ int cpu = smp_processor_id();
+
+ while (!softirq_pending(cpu))
+ sleep();
+}
+
+static void default_idle(void)
+{
+ local_irq_disable();
+ if ( !softirq_pending(smp_processor_id()) )
+ safe_halt();
+ else
+ local_irq_enable();
+}
+
+void idle_loop(void)
+{
+ for ( ; ; ) {
+ page_scrub_schedule_work();
+ default_idle();
+ do_softirq();
+ }
+}
struct ns16550_defaults ns16550;
extern char __per_cpu_start[], __per_cpu_data_end[], __per_cpu_end[];
-extern void idle_loop(void);
/* move us to a header file */
extern void initialize_keytable(void);
return (unsigned long) &_etext;
}
-void idle_loop(void)
-{
- int cpu = smp_processor_id();
-
- for ( ; ; )
- {
- while (!softirq_pending(cpu)) {
- void sleep(void);
- page_scrub_schedule_work();
- sleep();
- }
- do_softirq();
- }
-}
-
static void __init do_initcalls(void)
{
initcall_t *call;
schedulers_start();
}
+extern void idle_loop(void);
+
void startup_cpu_idle_loop(void)
{
struct vcpu *v = current;